<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <%@ include file="/commons/basejs.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>标签管理</title>
    <script type="text/javascript">

    </script>
</head>
<body>
<script type="text/javascript">
    $(function() {
        console.log("typeStr:"+typeStr)
        if(typeStr != '0,1,2'){
            $('.typeControl').hide();
            console.log(typeStr)
            $('#addTypeVal').val(typeStr);

        }


        $('#locAddPid').combotree({
            url : '${path }/areaInfo/selectCityTree.do',
            parentField : 'pid',
            lines : true,
            panelHeight : 'auto'
        });

        $('#locAddForm').form({
            url : '${path }/special/locAdd.do',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    $('#locAddFormPage').dialog('close');
                    reloadLocDataGrid();
                } else {
                    var form = $('#locAddForm');
                    $.messager.alert('提示', eval(result.msg), 'warning');
                }
            }
        });
        
    });
</script>
<div style="padding: 3px;">
    <form id="locAddForm" method="post">
        <table class="grid">
            <tr>
                <td>位置名</td>
                <td><input name="name" type="text" placeholder="请输入位置名" class="easyui-validatebox span2" data-options="required:true" ></td>

            </tr>

            <tr >
                <td >平台</td>
                <td>
                    <select name="platform" class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
                        <option value="0">手机WAP</option>
                        <option value="1">PC</option>
                        <option value="2">APP</option>
                    </select>
                </td>

            </tr>
            <tr class="typeControl">
                <td>分类</td>
                <td>
                    <select name="type" id="addType" class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
                        <option value="0">轮播图</option>
                        <option value="1">分类</option>
                        <option value="2">专题</option>
                    </select>
                    <input id="addTypeVal" name="addTypeVal" type="hidden">
                </td>

            </tr>


            <tr>
                <td>排序</td>
                <td><input name="ord" value="0"  class="easyui-numberspinner" style="width: 140px; height: 29px;" required="required" data-options="editable:true"></td>
            </tr>


            <tr>
                <td>上级区域</td>
                <td colspan="3">
                    <select id="locAddPid" name="cityId" style="width: 200px; height: 29px;" required="required"></select>
                    <a class="easyui-linkbutton" href="javascript:void(0)" onclick="$('#locAddPid').combotree('clear');" >清空</a>
                </td>
            </tr>
        </table>
    </form>

</div>
</body>
</html>